<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<header>
    <link rel="stylesheet" type="text/css" media="screen" href="/css/base/common.css" title="Version 1">
    <link rel="stylesheet" type="text/css" media="screen" href="/css/base/reset.css" title="Version 1">
    <link rel="stylesheet" href="/js/compont/zTree_v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
    <script type="text/javascript" src="/js/base/jquery.min.js"></script>
    <script type="text/javascript" src="/js/compont/jquery/jquery.mytab.js"></script>
    <script type="text/javascript" src="/js/compont/zTree_v3/js/jquery.ztree.core-3.5.js"></script>
    <script type="text/javascript">

        var test = new Date(1431048236000);
        alert(test);

        $(function () {
            $("#tab-container").mytab({
                skinName: "ui-tab-simple"
            });

            $(document).bind("keydown",function(e){
                //alert(e.keyCode);
                e=window.event||e;
                alert(e.keyCode);
                if(e.keyCode==116){
                    e.keyCode = 0;
                    window.location.reload(); //屏蔽F5刷新键
                    return false; //屏蔽F5刷新键
                }
            });

            $('#main_content').load(function(){
                var $iframe = $(this),
                    $contents = $iframe.contents();
                $contents.find('body').keydown(function(e){
                    //alert(e.keyCode);
                    e=window.event||e;
                    if(e.keyCode==116){
                        e.keyCode = 0;
                        $iframe.attr('src', $iframe.attr('src'));
                        //$iframe.window.location.reload();
                        return false; //屏蔽F5刷新键
                    }
                });


                var iframeHref = main_content.window.location.href;
                if (iframeHref.match(/.*Emall\/front\/superadminlogin_openlogin.action.*/)) {
                    window.location.href = iframeHref;
                }

            });

            var setting = {
                data: {
                    simpleData: {
                        enable: true
                    }
                }
            };

            <c:forEach var="menuGroupGroup" items="${menuInfo}">
                var zNodes${menuGroupGroup.id} =[
                <c:forEach var="menuGroup" items="${menuGroupGroup.childPrivilegeDto}">
                    { id:${menuGroup.id}, pId:${menuGroup.parentId}, name:"${menuGroup.name}", open:true, isParent:true, url:"<%=request.getContextPath()%>${menuGroup.url}", target:"main_content"} ,
                    <c:if test="${menuGroup.childPrivilegeDto != null}">
                        <c:forEach var="menu" items="${menuGroup.childPrivilegeDto}">
                            { id:${menu.id}, pId:${menu.parentId}, name:"${menu.name}", open:true, url:"<%=request.getContextPath()%>${menu.url}", target:"main_content"},
                        </c:forEach>
                    </c:if>
                </c:forEach>
                ];

                $.fn.zTree.init($("#leftMenuTree${menuGroupGroup.id}"), setting, zNodes${menuGroupGroup.id});
            </c:forEach>
        });
    </script>
    <style type="text/css">
        #header{
            width:100%;
            height:120px;
            border:1px solid red;
        }

        .middle {
            height: 700px;
            width: 100%;
        }
        .left_menu {
            float: left;
            width: 200px;
            height: 100%;
            border:1px solid blue;

        }
        .main_content {
            float: left;
            width:790px;
            height: 100%;
            border:1px solid pink;
        }
        #main_content{
            width:100%;
            height: 100%;
        }
        .wrapper{
            width: 1000px;
            margin:0px auto;
        }
    </style>
</header>
<body>
<div class="wrapper">
    <div id="tab-container">
        <div id="header">
            <div id="tabNavDiv">
                <ul>

                    <c:if test="${menuInfo != null}">
                        <c:forEach var="menu" items="${menuInfo}">
                            <li targetDivId="${menu.id}">
                                <a>${menu.name}</a>
                            </li>
                        </c:forEach>
                    </c:if>

                </ul>
            </div>
        </div>


        <div class="middle">
            <div class="left_menu">
                <c:forEach var="menu" items="${menuInfo}">
                    <div id="${menu.id}">
                        <ul id="leftMenuTree${menu.id}" class="ztree"></ul>
                    </div>
                </c:forEach>

            </div>


            <div class="main_content">
                <iframe name="main_content" src="" frameborder="0" id="main_content"></iframe>

            </div>
        </div>
    </div>
</div>

</body>
</html>
